<template>
    <div>
        <!--卡片-->
        <el-card class="box-card">
            <!--定义面包屑-->
            <el-breadcrumb separator=">">
                <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>客户管理</el-breadcrumb-item>
                <el-breadcrumb-item>积分记录</el-breadcrumb-item>
            </el-breadcrumb>
            <el-divider></el-divider>
            <!--表单的搜索框杀杀杀
                 :model="双向绑定表单的数据"
            -->
<!--            <el-form :inline="true" :model="IntegralFormData"  class="demo-form-inline">-->
<!--                <el-form-item >-->
<!--                    <el-input v-model="IntegralFormData.username" placeholder="请输入积分名称"></el-input>-->
<!--                </el-form-item>-->

<!--                <el-form-item>-->
<!--                    <el-button type="primary"@click="quere"> 查询</el-button>-->
<!--                </el-form-item>-->
<!--            </el-form>-->

            <!--数据表格-->
            <template>
                <el-table
                        :data="tableData"
                        :border="true"
                        stripe
                        style="width: 100%">
                    <el-table-column
                            prop="id"
                            label="编号"
                            width="100">
                    </el-table-column>
                    <el-table-column
                            prop="memberId"
                            label="会员客户ID"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            prop="createTime"
                            label="创建记录时间">
                    </el-table-column>
                    <el-table-column
                            prop="changeType"
                            label="积分变化类型">
                    </el-table-column>
                    <el-table-column
                            prop="changeCount"
                            label="积分改变数量">
                    </el-table-column>
                    <el-table-column
                            prop="operateMan"
                            label="操作人员">
                    </el-table-column>
                    <el-table-column
                            prop="operateNote"
                            label="操作备注">
                    </el-table-column>
                    <el-table-column
                            prop="sourceType"
                            label="积分来源">
                    </el-table-column>
<!--                    <el-table-column label="操作" width="120">-->
<!--                        <template slot-scope="scope">-->
<!--                            <el-button type="danger" icon="el-icon-delete" circle @click="deleteIntegral(scope.row.id)"></el-button>-->
<!--                        </template>-->
<!--                    </el-table-column>-->
                </el-table>

                <!--                分页-->
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage"
                        :page-sizes="[5, 10, 15, 20]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
            </template>
        </el-card>

    </div>
</template>

<script>
    export default {
        name: "Integral",
        data(){
            return{
                editDialogVisible:false,
                pageSize:5,
                currentPage:1,
                tableData:[],
                IntegralFormData: {},
                total:0,
                id:'',
                IntegralForm:{},
            }
        },
        created() {
            this.initIntegralTable()
        },
        methods:{
            initIntegralTable(){
                var that = this;
                this.$http.post(`/manage/integral/initIntegral/${this.currentPage}/${this.pageSize}`,this.IntegralFormData).then(function (resp) {
                    that.tableData=resp.data.result.records;
                    that.total = resp.data.result.total;
                })
            },

            // deleteIntegral(id){
            //     var that=this;
            //     this.$http.delete(`/manage/integral/deleteIntegral/${id}`, this.IntegralFormData).then(function (resp) {
            //         that.initLevelTable();
            //     })
            // },

            handleSizeChange(v){
                this.pageSize = v;
                this.currentPage();
            },
            //切换页码时触发该方法
            handleCurrentChange(v){
                this.currentPage = v;
                this.initIntegralTable();
            },
            quere() {
                this.initIntegralTable()
            },


        }

    }
</script>

<style scoped>

</style>